{% extends "NartiBouncerBundle::base.html.twig" %}

{% block css %}
<style>
 label, input{  display: block; }
 input.text { margin-bottom:12px; width:95%; padding: .4em; }
 fieldset { padding:0; border:0; margin-top:25px; }
</style>
{% endblock %}



{% block main %}
<div id="dialog-form" title="Ingresso Bouncer">
     Dammi bouncer e password. Sei senza ? <a id="reg" href="{{ path('account_register') }}">Registrati</a>
    <form action="{{ path("bouncing_check") }}" method="post" id="login">
    <fieldset>
        <div id="client-error"></div>
        {% if error %}
             <div class="ui-state-highlight">{{ error.message }}</div>
        {% endif %}
        <label for="username">Bouncer</label>
        <input type="text" name="_username" id="username" value="{{ last_username }}" class="text ui-widget-content ui-corner-all" />
        <label for="password">Password</label>
        <input type="password" name="_password" id="password" value="" class="text ui-widget-content ui-corner-all" />
    </fieldset>
    </form>
</div>
{%endblock main%}

{% block js %}
<script type="text/javascript">
    $(function(){
        $("#dialog-form").dialog({
                    height: 360,
                    width: 350,
                    buttons: {
			"Login": function() {
                            $("#client-error").text("").removeClass("ui-state-highlight");    
                            if( $("#username").val().length == 0){
                                $("#client-error").text("Digita bouncer").addClass("ui-state-highlight");    ;
                                return false;
                            }    
                            if($("#password").val().length == 0){
                                $("#client-error").text("Digita password").addClass("ui-state-highlight");    ;
                                return false;
                            }    
                            $("#login").submit();
                        } 
                    }    
         });
         
       $("#reg").button();
                     
    });
</script>  
{% endblock %}            





